// pages/index1/index1.js
var WxParse = require('../wxParse/wxParse.js');
var app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    startupImg:[],
    icon: '../../images/logo.png',
    ulifeUrl: app.myUlife.ulifeUrl,//服务器路径
    wxts:'播州区机关幼儿园登记系统旨在便捷登记流程，透明报名结果。',

    sfkqbm:'',
    bmjzrq:'',
    rxstart:'', 
    rxend:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function () {
    wx.clearStorageSync();
    wx.showLoading({
      title: '加载中',
    })
    //获取用户是否已经绑定了账号，如果已经绑定，则查看是否绑定了多个账号
    this.getSystemInfo();
  },

  getSystemInfo: function () {
    var that = this;
    wx.request({
      url: app.myUlife.ulifeUrl + '/wechart/getSystemInfo.html',//请求地址
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: function (res) {
        if (res.data.sfkqbm) {
          wx.setStorageSync('sfkqbm', res.data.sfkqbm);
        }
        if (res.data.bmjzrq) {
          wx.setStorageSync('bmjzrq', res.data.bmjzrq);
        }
        if (res.data.rxstart) {
          wx.setStorageSync('rxstart', res.data.rxstart);
        }
        if (res.data.rxend) {
          wx.setStorageSync('rxend', res.data.rxend);
        }
        if (res.data.wxts) {
          WxParse.wxParse('cpnr', 'html', res.data.wxts, that, 5);
        }
        wx.hideLoading()
      }
    })
  },
  intoBmxt: function () {
    var sfkqbm = wx.getStorageSync('sfkqbm');
    console.log(sfkqbm)
    wx.redirectTo({
      url: '../../pages/auth/auth'
    })
  }

})
